// by tankbuster
//#define __DEBUG__
#define THIS_FILE "x_m93.sqf"
#include "x_setup.sqf"
private ["_fail", "_minecount", "_mine", "_helper1", "_mpos"];
_mpos = markerPos QGVAR(sm_593);
_mpos set [2,0];
GVAR(x_sm_pos) = [_mpos]; // index: 93, naval mine clearance Pefkas Bay
GVAR(x_sm_type) = "normal"; // "convoy"
#ifdef __SMMISSIONS_MARKER__
if (true) exitWith {};
#endif

if (X_Client && {!GVAR(IS_HC_CLIENT)}) then {
	GVAR(cur_sm_txt) = (localize "STR_DOM_MISSIONSTRING_5060");
	GVAR(current_mission_resolved_text) = (localize "STR_DOM_MISSIONSTRING_5061");
};

if (call FUNC(checkSHC)) then {
	_minecount = 4;
	_mines = [];
	for "_i" from 0 to (_minecount - 1) do {
		_helper1 = createVehicle [GVAR(HeliHEmpty), _mpos, [],50, "NONE"];// 20 -> 50 for final
		_mine = createMine ["UnderwaterMine", [getPosASL _helper1 select 0, getPosASL _helper1 select 1, (random (getPosASL _helper1 select 2))], [],0];
		_mines set [count _mines, _mine];
		deleteVehicle _helper1;
	};
	[_mpos, _mines] spawn FUNC(clearnavalmines);
};
